#include "capture.h"
#include "onu_comm.h"
#include "dial.h"

extern thread_pool_t *Tpool;


void *icmp_task(void *arg){
    
    dial_arg_t dial_arg = {0};
    dial_result_t *dial_result;

    //dial_arg.bridge_mode = 1;
    dial_arg.in.ping_arg.ip = inet_addr("8.8.8.8");
    dial_arg.in.ping_arg.counts = 5;
    dial_arg.in.ping_arg.timeout = 2;
    dial_arg.in.ping_arg.blocksize = 1460;
    dial_result = (dial_result_t*)dial_ping(&dial_arg);
    ping_result_print(&dial_result->out.ping_result);
    free(dial_result);

    return NULL;
}

int icmp_task_init(int argc, char **argv){
    thread_pool_add_task(Tpool, icmp_task, NULL);
    return 0;
}